package aos.server.robot;

import org.apache.log4j.Logger;

public class LocalRobotControllerProxy implements RobotControllerProxy {
	
	Logger logger = Logger.getLogger(LocalRobotControllerProxy.class);
	double x;
	double y;
	RobotController robotController;
	
	public LocalRobotControllerProxy() {
		x = -1.0;
		y = -1.0;
		robotController = new RobotController();
		logger.info("Local robot control proxy initialized");
	}
		
	public void setPosition(double x, double y) {
		if (this.x != x || this.y != y) {
			this.x = x;
			this.y = y;
			updatePosition();
		}
	}
	
	protected void updatePosition() {
		logger.info("Update position x: " + this.x + "; y: " + this.y);
		robotController.updatePosition(this.x, this.y);
	}

}
